import { useEffect, useState } from "react";
import { getChannelsAPI } from "@/apis/article";
function useChannel() {
  const [channelList, setChannelList] = useState([]);
  useEffect(() => {
    //获取频道数据
    const getChanelsList = async () => {
      const res = await getChannelsAPI();
      setChannelList(res.data.channels);
    };
    getChanelsList();
  }, []);
  return {
    channelList,
  };
}

export { useChannel };
